package com.haibeimohe.service;

import com.haibeimohe.pojo.User;
import org.springframework.stereotype.Service;

/**
 * 实现类
 * @author hassan
 */
@Service
public class UserServiceImpl implements IUserService {

    @Override
    public String sayHello(String msg) {
        System.out.println("sayHello 收到来自客户端的请求 :" + msg);
        return "返回给客户端的结果 : " + msg;
    }

    @Override
    public String login(String username, String password) {
        System.out.println("login 收到来自客户端的请求 username : " +  username + " password : " + password);
        if ("admin".equals(username) && "admin".equals(password)) {
            return "success";
        }
        return "fail";
    }

    @Override
    public String login(User user) {
        System.out.println("login user 收到来自客户端的请求 username : " +  user.getUsername() + " password : " + user.getPassword());
        if ("admin".equals(user.getUsername()) && "admin".equals(user.getPassword())) {
            return "success";
        }
        return "fail";
    }


}
